bitmap_*() should cope with zero size bitmaps
authorJan Beulich <jbeulich@suse.com>
Thu, 4 Jul 2013 08:26:24 +0000 (10:26 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Jul 2013 08:26:24 +0000 (10:26 +0200)
commitd8a7694e5a415ac0a871f0ae58f50876ad30d619
tree25f59d59e87e76e322b5d2dabc1602b3a47f9482
parent966e77e9d6855274954d2d38eca2393121da477d
bitmap_*() should cope with zero size bitmaps

... to match expectations set by memset()/memcpy().

Similarly for find_{first,next}_{,zero_}_bit() on x86.

__bitmap_shift_{left,right}() would also need fixing (they more
generally can't cope with the shift count being larger than the bitmap
size, and they perform undefined operations by possibly shifting an
unsigned long value by BITS_PER_LONG bits), but since these functions
aren't really used anywhere I wonder if we wouldn't better simply get
rid of them.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/include/asm-x86/bitops.h
xen/include/xen/bitmap.h